FROM python:3.13-slim

WORKDIR /root
COPY . .
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip install gradio fastapi uvicorn
RUN <<EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free non-free-firmware
EOF


EXPOSE 8000
ENV GRADIO_SERVER_NAME="0.0.0.0"
# 设置时区为东八区
ENV TZ=Asia/Shanghai

RUN ln -fs /usr/share/zoneinfo/$TZ /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
CMD ["gradio main.py"]